<?php 
header("content-type:text/html;charset=utf8");
$uid = isset($_GET['uid'])?$_GET['uid']:'';
$mid = isset($_GET['mid'])?$_GET['mid']:'';
$return = array();
if ($uid && $mid) {
	//参数正确，获取基本信息
	$payMovieInfo = getPayMovieStatus($uid,$mid);
	if ($payMovieInfo) {
		$return['code'] = 10000;
		$return['data'] = 'movie already pay';
	}else{
		$return['code'] = 10002;
		$return['data'] = 'pay information non existent';
	}
}else{
	//参数缺少，请确认参数信息
	$return['code'] = 10001;
	$return['data'] = 'Lack of necessary parameters';
}

echo json_encode($return);

//通过uid和mid获取此条信息的支付信息
function getPayMovieStatus($uid,$mid){
	$pdo = new PDO('mysql:host=123.57.16.97;dbname=project','root','zqVnUy6cxsQXbpEZ');
	$pdo->exec("set names utf8");
	$sql = "SELECT `oid` FROM `order` WHERE uid = '$uid' AND mid = '$mid' AND `status` = 1";
	$payMovieInfo = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC);
	return $payMovieInfo;
}

 ?>